package com.will.seed.websocket;

import io.netty.channel.ChannelHandlerContext;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * Created by Administrator on 2018/8/21.
 */
public class ChannelManager {

    private ConcurrentMap<String,ChannelHandlerContext> channelCtxMap;
    private ConcurrentMap<String,SyncReceiver> receiverMap;

    private static final ChannelManager INSTANCE = new ChannelManager();

    private ChannelManager() {
        channelCtxMap = new ConcurrentHashMap<>();
        receiverMap = new ConcurrentHashMap<>();
    }

    public static ChannelManager getInstance() {
        return INSTANCE;
    }

    public ConcurrentMap<String, ChannelHandlerContext> getChannelCtxMap() {
        return channelCtxMap;
    }

    public ConcurrentMap<String, SyncReceiver> getReceiverMap() {
        return receiverMap;
    }
}
